﻿@{
    ViewBag.Title = "设备档案明细";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts{
        <script src="~/Areas/Dev/ViewModels/Dev.com.js"></script>
        <script src="/Content/js/viewModel/com.viewModel.edit.js"></script>
        <script type="text/javascript">
            using(['numberbox','lookup','combobox']);
            var viewModel = function(data){ 
                var self = this;
                com.viewModel.edit.apply(self,arguments);
                this.grid0.size={w:8,h:73};
                this.grid1.size={w:8,h:73};
                this.grid2.size={w:8,h:73};
            } 
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            ko.bindingViewModel(new viewModel(data));
        </script>
}
<div class="z-toolbar">
    <a id="a_save" href="#" plain="true" class="easyui-linkbutton" icon="icon-save" data-bind="click:readonly()?null:saveClick,linkbuttonDisable:readonly" title="保存">保存</a>
    <a id="a_undo" href="#" plain="true" class="easyui-linkbutton" icon="icon-undo" data-bind="click:readonly()?null:rejectClick,linkbuttonDisable:readonly" title="撤消">撤消</a>
    <a id="a_audit" href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick,easyuiLinkbutton:approveButton" title="审核">审核</a>
   @* <a id="a_printer" href="#" plain="true" class="easyui-linkbutton" icon="icon-printer" title="打印" data-bind="click:printClick">打印</a>*@
    <div class="datagrid-btn-separator"></div>
    <a id="a_first" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_first" data-bind="click:firstClick,linkbuttonEnable:pageData.scrollKeys.firstEnable" title="第一条"></a> 
    <a id="a_previous" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_previous" data-bind="click:previousClick,linkbuttonEnable:pageData.scrollKeys.previousEnable" title="上一条"></a> 
    <a id="a_next" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_next" data-bind="click:nextClick,linkbuttonEnable:pageData.scrollKeys.nextEnable" title="下一条"></a> 
    <a id="a_last" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_last" data-bind="click:lastClick,linkbuttonEnable:pageData.scrollKeys.lastEnable" title="最后一条"></a> 
</div>

<div id="div1" class="easyui-tabs">
    <div title="设备信息">
        <div id="master" class="container_12" data-bind="inputwidth:0.9,autoheight:73" >
         <div class="grid_1 lbl"></div>
        <div class="clear"></div>
        <div class="grid_1 lbl">设备编码</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Sbbm,readOnly:true" class="z-txt readonly"/></div>
        <div class="grid_1 lbl required">设备名称</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Sbmc" class="z-txt" required="true" /></div>
        <div class="grid_1 lbl">类别编号</div>
        <div class="grid_3 val"><input type="text"  data-bind="lookupValue:pageData.form.Sbda_lbbh,lookupReadOnly:readonly" required="true" class="z-txt easyui-lookup" data-options="lookupType:'sblbzd',parentField:'pid',multiple:false"/></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">设备状态</div>
        <div class="grid_3 val"><input type="text" data-bind="comboboxValue:pageData.form.Sbda_Sbzt,datasource:dataSource.sbztItems,comboboxReadOnly:readonly" class="z-txt easyui-combobox" required="true" /></div>
        <div class="grid_1 lbl">规格型号</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Ggxh" class="z-txt"/></div>
        <div class="grid_1 lbl">原值</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Yz" class="z-txt easyui-numberbox" data-options="min: 0, precision: 2"/></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">设备厂商 </div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Sbcs" class="z-txt" /></div>
        <div class="grid_1 lbl">制造厂商 </div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Zzcs" class="z-txt" /></div>
        <div class="grid_1 lbl">构建方式 </div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Gjfs" class="z-txt" /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">出厂编号</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Ccbh" class="z-txt" /></div>
        <div class="grid_1 lbl lbs">出厂时间</div>
        <div class="grid_3 val"><input type="text" data-bind="dateboxValue:pageData.form.Sbda_Ccsj" class="z-txt easyui-datebox" /></div>
        <div class="grid_1 lbl lbs">净值</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Jz" class="z-txt easyui-numberbox" data-options="min: 0, precision: 2"/></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">主电机功率</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Zjdjgl" class="z-txt easyui-numberbox" data-options="min: 0, precision: 2"/></div>
        <div class="grid_1 lbl">总电机功率</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Zdjgl" class="z-txt easyui-numberbox" data-options="min: 0, precision: 2"/></div>
        <div class="grid_1 lbl">特种设备</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Tzsb" class="z-txt" /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">净残值率</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Jczl" class="z-txt easyui-numberbox" data-options="min: 0, precision: 2"/></div>
        <div class="grid_1 lbl">主机或系统</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Sszjhxt" class="z-txt" /></div>
        <div class="grid_1 lbl">购置费</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Gzf" class="z-txt" /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">基础费</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Jcf" class="z-txt easyui-numberbox" data-options="min: 0, precision: 2"/></div>
        <div class="grid_1 lbl">回收残值</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Hscz" class="z-txt easyui-numberbox" /></div>
        <div class="grid_1 lbl">配套电机台数</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Ptdjts" class="z-txt easyui-numberbox" /></div>

        <div class="clear"></div>
        <div class="grid_1 lbl">附件张数</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Fjzs" class="z-txt easyui-numberbox" data-options="min: 0, precision: 0"/></div>
        <div class="grid_1 lbl">数据来源</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Sjly" class="z-txt" /></div>
        <div class="grid_1 lbl">注销原因</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Zxyy" class="z-txt" /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">保养周期</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Byzq" class="z-txt easyui-numberbox" data-options="min: 0, precision: 0"/></div>
        <div class="grid_1 lbl">最近保养时间</div>
        <div class="grid_3 val"><input type="text" data-bind="dateboxValue:pageData.form.Sbda_Zjbysj" class="z-txt easyui-datebox" /></div>
        <div class="grid_1 lbl">备注说明</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.Sbda_Remark" class="z-txt" /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">润滑周期</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Yhzq" class="z-txt easyui-numberbox" data-options="min: 0, precision: 0"/></div>
        <div class="grid_1 lbl">最近润滑时间</div>
        <div class="grid_3 val"><input type="text" data-bind="dateboxValue:pageData.form.Sbda_Zjyhsj" class="z-txt easyui-datebox" /></div>
        <div class="grid_1 lbl">建档人</div>
        <div class="grid_3 val"><input type="text" data-bind="value:pageData.form.CreatePerson,readOnly:true" class="z-txt"  /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">维修周期</div>
        <div class="grid_3 val"><input type="text" data-bind="numberboxValue:pageData.form.Sbda_Wxzq" class="z-txt easyui-numberbox" data-options="min: 0, precision: 0"/></div>
        <div class="grid_1 lbl">最近维修时间</div>
        <div class="grid_3 val"><input type="text" data-bind="dateboxValue:pageData.form.Sbda_Zjwxsj" class="z-txt easyui-datebox" /></div>
        <div class="grid_1 lbl">建档时间</div>
        <div class="grid_3 val"><input type="text" data-bind="dateboxValue:pageData.form.CreateDate,dateboxReadOnly:true" class="z-txt easyui-datebox" /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">使用单位</div>
        <div class="grid_3 val"><input type="text"  data-bind="lookupValue:pageData.form.Sbda_Sydwbh,lookupReadOnly:readonly" required="true" class="z-txt easyui-lookup" data-options="lookupType:'organize',parentField:'pid',multiple:false"/></div>
        <div class="clear"></div>
        </div>
    </div>
     <div title="关键部位" style="padding-top:2px;">
     <table data-bind="datagrid:grid0">
        <thead>
            <tr> 
                <th field="Gjbw_Sbbh"       hidden="true">设备编号</th>  
                <th field="Gjbw_Bwbh"       sortable="true" align="left"    width="120" editor="text">关键部位编号   </th>  
                <th field="Gjbw_Bwmc"       sortable="true" align="left"    width="100" editor="text" >关键部位名称  </th>  
                <th field="Gjbw_Bwms"       sortable="true" align="center"  width="100" editor="text" >关键部位描述  </th>  
                <th field="Gjbw_Djbz"       sortable="true" align="center"  width="100" editor="{type:'checkbox',options:{on:1,off:0}}" formatter="com.formatCheckbox2">点检标志</th>  
                <th field="Gjbw_Bybz"       sortable="true" align="center"  width="100" editor="{type:'checkbox',options:{on:1,off:0}}" formatter="com.formatCheckbox2">保养标志</th>  
                <th field="Gjbw_Yhbz"       sortable="true" align="center"  width="100" editor="{type:'checkbox',options:{on:1,off:0}}" formatter="com.formatCheckbox2">润滑标志</th> 
                <th field="Gjbw_Remark"     sortable="true" align="left"    width="200" editor="text">备注说明</th>   
            </tr>
        </thead>
    </table>
     <div id="gridtb0">
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" data-bind="click:readonly()?null:grid0.addRowClick,linkbuttonDisable:readonly">新增</a>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" data-bind="click:readonly()?null:grid0.removeRowClick,linkbuttonDisable:readonly">删除</a>
        </div>  
</div>
  <div title="技术参数" style="padding-top:2px;">
     <table   data-bind="datagrid:grid1">
        <thead>
            <tr> 
                <th field="Jscs_Sbbh"     hidden="true">设备编号</th>  
                <th field="Jscs_Csbh"     sortable="true" align="left"     width="120" editor="text" >参数编号   </th>  
                <th field="Jscs_Csmc"     sortable="true" align="left"     width="100" editor="text" >参数名称  </th>  
                <th field="Jscs_Csms"     sortable="true" align="left"   width="100" editor="text" >参数描述  </th>  
                <th field="Jscs_Bzz"      sortable="true" align="right"   width="100" editor="{type:'numberbox',options:{precision:0}}">标准值  </th>  
                <th field="Jscs_Sxz"      sortable="true" align="right"   width="100" editor="{type:'numberbox',options:{precision:0}}" >上限值  </th>  
                <th field="Jscs_Xxz"      sortable="true" align="right"   width="100" editor="{type:'numberbox',options:{precision:0}}" >下限值  </th>  
                <th field="CreatePerson"  sortable="true" align="center"     width="200" editor="text">录入人</th>   
            </tr>
        </thead>
    </table>
    <div id="gridtb1">
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" data-bind="click:readonly()?null:grid1.addRowClick,linkbuttonDisable:readonly">新增</a>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" data-bind="click:readonly()?null:grid1.removeRowClick,linkbuttonDisable:readonly">删除</a>
    </div>  
</div>


 <div title="附属设备" style="padding-top:2px;">
     <table   data-bind="datagrid:grid2">
        <thead>
            <tr> 
                <th field="Fssb_Sbbh"     hidden="true">设备编号</th>  
                <th field="Fssb_Fssbbh"     sortable="true" align="left"     width="80" editor="text" >附属编号   </th>  
                <th field="Fssb_Fssbmc"     sortable="true" align="left"     width="100" editor="text" >附属名称  </th>  
                <th field="Fssb_Ggxh"     sortable="true" align="left"     width="80" editor="text" >规格型号  </th>
                <th field="Fssb_Zzcj"     sortable="true" align="left"     width="120" editor="text" >制造厂家  </th>
                <th field="Fssb_Jldw"     sortable="true" align="left"     width="50" editor="text" >单位  </th>
                <th field="Fssb_Remark"     sortable="true" align="left"   width="140" editor="text" >描述  </th>  
                <th field="Fssb_Sl"      sortable="true" align="right"   width="100" editor="{type:'numberbox',options:{precision:0}}">数量  </th>  
                <th field="Fssb_Yz"      sortable="true" align="right"   width="100" editor="{type:'numberbox',options:{precision:0}}">原值  </th>  
                <th field="CreatePerson"  sortable="true" align="center"     width="80" editor="text">录入人</th>   
            </tr>
        </thead>
    </table>
    <div id="gridtb2">
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" data-bind="click:readonly()?null:grid2.addRowClick,linkbuttonDisable:readonly">新增</a>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" data-bind="click:readonly()?null:grid2.removeRowClick,linkbuttonDisable:readonly">删除</a>
    </div>  
</div>

</div>
   
 
